package com.download.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.download.web.entity.BusBuy;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface BusBuyMapper extends BaseMapper<BusBuy> {
    @Select("SELECT * FROM bus_buy as b LEFT JOIN sys_user as u ON b.user_id=u.id WHERE 1=1 ${sql} LIMIT #{page},#{limit}")
    public List<Map<String,Object>> selectAll(@Param("sql")String sql, @Param("page")int page, @Param("limit")int limit);

    @Select("SELECT count(1) FROM bus_buy as b WHERE 1=1 ${sql} ")
    public Integer selectAllCount(@Param("sql")String sql);
}
